import { AjaxUtil } from '@/utils/AjaxUtil';

type NavMenu = {
  name: string;
  price?: string;
  pic?: string;
  type?: string;
  id?: number;
  url?: string;
  children?: NavMenu[];
};
export default {
  /**
   * 查询导航菜单
   */
  searchNavMenu: async function () {
    const ajaxResp = await AjaxUtil.get<NavMenu[]>(
      { url: '/api/index/navMenu' },
      AjaxUtil.AntiReplayModel.DISCARD_NEW,
    );
    return ajaxResp;
  },
  /**
   * 查询轮播图
   */
  searchSlideData: async function () {
    const ajaxResp = await AjaxUtil.get(
      { url: '/api/index/slideData' },
      AjaxUtil.AntiReplayModel.DISCARD_NEW,
    );
    return ajaxResp;
  },
};
